package vnreal.ZNEW.GraphTest;

import java.util.ArrayList;
import java.util.List;
import java.util.Stack;

public class Path {

	public Stack<String> allPaths = new Stack<String>();
	public List<SubstrateLink> subLink = new ArrayList<SubstrateLink>();
	
	@Override
	public String toString() {
		String s = "";
		s += "Path: " + allPaths + "\n";
		s += "*************************************************************************\n";
		s += String.format(SubstrateLink.format, "Id", "Source", "Destination", "Bandwidth", "Length", "Type");
		s += "-------------------------------------------------------------------------\n";
		for(SubstrateLink link : subLink) {
			s += link;
		}
		s += "*************************************************************************\n";
		return s;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((allPaths == null) ? 0 : allPaths.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Path other = (Path) obj;
		if (allPaths == null) {
			if (other.allPaths != null)
				return false;
		} else if (!allPaths.equals(other.allPaths))
			return false;
		return true;
	}
	
}
